{% extends "base.html" %}
{% load static %}



{% load render_thermo %}
{% load render_states %}
{% load render_collision %}

{% block title %}{{ label }} - {{ network.title }}{% endblock %}

{% block navbar_items %}
<li><a href="{% url 'pdep:index' %}">Pressure Dependent Networks</a></li>
<li><a href="{% url 'pdep:network-index' networkKey=networkKey%}">{{ network.title }}</a></li>
<li><a href="{% url 'pdep:network-species' species=label networkKey=networkKey%}">{{ label }}</a></li>
{% endblock %}

{% block sidebar_items %}
{% include "networkSidebar.html" %}
{% endblock %}

{% block page_title %}{{ label }} - {{ network.title }}{% endblock %}

{% block extrahead %}
<script src="https://code.highcharts.com/6/highcharts.js"></script>
<script src="{% static 'js/highcharts.theme.js' %}" type="text/javascript"></script>

<script type="text/javascript">
jQuery(document).ready(function() {

    var Cpseries = new Array();
    var Hseries = new Array();
    var Sseries = new Array();
    var Gseries = new Array();
    var Qseries = new Array();
    var rhoseries = new Array();
    var Vseries = new Array();
    
    {% if species.thermo %}
    {{ species.thermo|get_thermo_data:user }}
    {% include "thermoModel.js" %}
    {% endif %}
    
    {% if species.conformer %}
    {{ species.conformer|get_states_data:user }}
    {% include "statesModel.js" %}
    {% endif %}
    
    MathJax.Hub.Queue(function() {
        {% if species.thermo %}
        plotHeatCapacity('plotCp', Cpseries);
        plotEnthalpy('plotH', Hseries);
        plotEntropy('plotS', Sseries);
        plotFreeEnergy('plotG', Gseries);
        {% endif %}
        {% if species.conformer %}
        plotPartitionFunction('plotQ', Qseries);
        plotDensityOfStates('plotRho', rhoseries);
        if (Vseries.length > 0)
            plotHinderedRotorPotential('plotV', Vseries);
        {% endif %}
    });
    
    
});
</script>
{% endblock %}

{% block page_body %}

<h2>Structure</h2>

<p>{{ structure|safe }}</p>


{% if E0 %}
<h2>Ground-state energy</h2>

<p>{{ E0 }} kcal/mol</p>
{% endif %}

{% if species.transport_data %}
<h2>Collision Parameters</h2>
{{ species|render_collision_math:user }}

{% endif %}

{% if species.conformer %}
<h2>Molecular Degrees of Freedom</h2>
{{ species.conformer|render_states_math:user }}

<div id="plotQ" style="width: 500px; height: 300px; margin: auto;"></div>
<div id="plotRho" style="width: 500px; height: 300px; margin: auto;"></div>
{% if hasTorsions %}
<div id="plotV" style="width: 500px; height: 400px; margin: auto;"></div>
{% endif %}

{% endif %}

{% if species.thermo %}
<h2>Thermodynamics</h2>
{{ species.thermo|render_thermo_math }}

<div id="plotCp" style="width: 500px; height: 300px; margin: auto;"></div>
<div id="plotH" style="width: 500px; height: 300px; margin: auto;"></div>
<div id="plotS" style="width: 500px; height: 300px; margin: auto;"></div>
<div id="plotG" style="width: 500px; height: 300px; margin: auto;"></div>

{% endif %}

{% endblock %}
